package com.damai.action.meta;

import java.util.List;

import com.damai.meta.MetaData;


public class ApiMetaData extends MetaData {
	
	public static final int API_DEFAULT = 0;
	public static final int API_SIMPLE_JSON = 1;
	
	
	public static final int TOKEN_NONE = 0;
	public static final int TOKEN_NO_LOGIN = 1;
	public static final int TOKEN_LOGIN = 2;
	
	
	
	/**
	 * api本身的类别{API_DEFAULT,API_SIMPLE_JSON}
	 */
	private int type;
	
	
	private int token;// 0 不需要 1:需要token 2:需要登录
	
	/**
	 * 需要登录
	 */
	private boolean needsLogin;
	
	/**
	 * 加密方式
	 */
	private int crypt;
	
	/**
	 * 返回类型
	 */
	private String returnType;
	
	/**
	 * mock参数
	 */
	private String mock;
	
	/**
	 * 
	 */
	private String remark;
	
	/**
	 * 
	 */
	private List<ParamInfo> params;
	
	
	private List<ParamInfo> results;
	
	
	/**
	 * 
	 * @param type   api类别，一般为默认Api或者SimpleApiAcitonFactory
	 */
	public ApiMetaData(int type){
		this.type = type;
	}
	
	
	public String getId(){
		return name.replace("/", "");
	}
	
	
	public List<ParamInfo> getParams() {
		return params;
	}
	public void setParams(List<ParamInfo> params) {
		this.params = params;
	}
	public boolean isNeedsLogin() {
		return needsLogin;
	}
	public void setNeedsLogin(boolean needsLogin) {
		this.needsLogin = needsLogin;
	}
	public int getCrypt() {
		return crypt;
	}
	public void setCrypt(int crypt) {
		this.crypt = crypt;
	}
	public String getReturnType() {
		return returnType;
	}
	public void setReturnType(String type) {
		this.returnType = type;
	}
	public List<ParamInfo> getResults() {
		return results;
	}
	public void setResults(List<ParamInfo> returns) {
		this.results = returns;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	


	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}


	public int getToken() {
		return token;
	}


	public void setToken(int token) {
		this.token = token;
	}


	public String getMock() {
		return mock;
	}


	public void setMock(String mock) {
		this.mock = mock;
	}
	
}
